package com.gxa.web.controller;

import com.alibaba.fastjson.JSONObject;
import com.gxa.common.JsonResult;
import com.gxa.service.CustomerService;
import com.gxa.service.impl.CustomerServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/customer_satisfaction/delete")
public class CustomerSatisfactionDelServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取id数组
        String[] ids = request.getParameterValues("ids");
        //调用service
        CustomerService customerService = new CustomerServiceImpl();
        JsonResult jsonResult = customerService.batchDelService(ids);
        //响应jsonResult
        response.setContentType("application/json; charset=UTF-8");
        response.getWriter().write(JSONObject.toJSONString(jsonResult));
    }
}
